import React from 'react';
import { Link, useRouteMatch } from 'react-router-dom';

import routesType from "../../routes/routesType";
import routes from '../../routes/index';


interface RouterParams {
    url:string
}

const Error404:React.FC = props => {
  console.log(props);
  const params = useRouteMatch<RouterParams>();
  return (
    <div>
      <h1>404 {params.url}</h1>
      <ol>
        {routes.map((v:routesType, i:number) => (
          <li key={i}>
            <Link to={v.path}>{v.title}</Link>
          </li>
        ))}
      </ol>
    </div>
  );
};

export default Error404;
